 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

elite相关API
elite相关API

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKElite/EliteExecutor.h>

@implementation EliteClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"elite.cn-south-1.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 elite  v1";
    _serviceName = @"elite";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 elite  v1";
    _serviceName = @"elite";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"elite.cn-south-1.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 elite  v1";
    _serviceName = @"elite";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 elite  v1";
    _serviceName = @"elite";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
listSaleService sync request
@param listSaleServiceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `listSaleServiceResponse` the request response data model
*/
-(NSDictionary*) listSaleServiceSyncWithRequest:(EliteListSaleServiceRequest*) listSaleServiceRequest
{
EliteListSaleServiceExecutor* excutor = [[EliteListSaleServiceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:listSaleServiceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteListSaleServiceResponse* response = [[EliteListSaleServiceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"listSaleServiceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)listSaleServiceAsyncWithRequest:(EliteListSaleServiceRequest*) listSaleServiceRequest
                       completionHandler:(void(^)(int statusCode,EliteListSaleServiceResponse* _Nullable listSaleServiceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteListSaleServiceExecutor* excutor = [[EliteListSaleServiceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:listSaleServiceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteListSaleServiceResponse* response = [[EliteListSaleServiceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
jdxQueryPrice sync request
@param jdxQueryPriceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `jdxQueryPriceResponse` the request response data model
*/
-(NSDictionary*) jdxQueryPriceSyncWithRequest:(EliteJdxQueryPriceRequest*) jdxQueryPriceRequest
{
EliteJdxQueryPriceExecutor* excutor = [[EliteJdxQueryPriceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:jdxQueryPriceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryPriceResponse* response = [[EliteJdxQueryPriceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"jdxQueryPriceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)jdxQueryPriceAsyncWithRequest:(EliteJdxQueryPriceRequest*) jdxQueryPriceRequest
                       completionHandler:(void(^)(int statusCode,EliteJdxQueryPriceResponse* _Nullable jdxQueryPriceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteJdxQueryPriceExecutor* excutor = [[EliteJdxQueryPriceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:jdxQueryPriceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryPriceResponse* response = [[EliteJdxQueryPriceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
jdxQueryDeliveryInfo sync request
@param jdxQueryDeliveryInfoRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `jdxQueryDeliveryInfoResponse` the request response data model
*/
-(NSDictionary*) jdxQueryDeliveryInfoSyncWithRequest:(EliteJdxQueryDeliveryInfoRequest*) jdxQueryDeliveryInfoRequest
{
EliteJdxQueryDeliveryInfoExecutor* excutor = [[EliteJdxQueryDeliveryInfoExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:jdxQueryDeliveryInfoRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryDeliveryInfoResponse* response = [[EliteJdxQueryDeliveryInfoResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"jdxQueryDeliveryInfoResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)jdxQueryDeliveryInfoAsyncWithRequest:(EliteJdxQueryDeliveryInfoRequest*) jdxQueryDeliveryInfoRequest
                       completionHandler:(void(^)(int statusCode,EliteJdxQueryDeliveryInfoResponse* _Nullable jdxQueryDeliveryInfoResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteJdxQueryDeliveryInfoExecutor* excutor = [[EliteJdxQueryDeliveryInfoExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:jdxQueryDeliveryInfoRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryDeliveryInfoResponse* response = [[EliteJdxQueryDeliveryInfoResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getStoreService sync request
@param getStoreServiceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getStoreServiceResponse` the request response data model
*/
-(NSDictionary*) getStoreServiceSyncWithRequest:(EliteGetStoreServiceRequest*) getStoreServiceRequest
{
EliteGetStoreServiceExecutor* excutor = [[EliteGetStoreServiceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getStoreServiceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteGetStoreServiceResponse* response = [[EliteGetStoreServiceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getStoreServiceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getStoreServiceAsyncWithRequest:(EliteGetStoreServiceRequest*) getStoreServiceRequest
                       completionHandler:(void(^)(int statusCode,EliteGetStoreServiceResponse* _Nullable getStoreServiceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteGetStoreServiceExecutor* excutor = [[EliteGetStoreServiceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getStoreServiceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteGetStoreServiceResponse* response = [[EliteGetStoreServiceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
jdxReportOrder sync request
@param jdxReportOrderRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `jdxReportOrderResponse` the request response data model
*/
-(NSDictionary*) jdxReportOrderSyncWithRequest:(EliteJdxReportOrderRequest*) jdxReportOrderRequest
{
EliteJdxReportOrderExecutor* excutor = [[EliteJdxReportOrderExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:jdxReportOrderRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxReportOrderResponse* response = [[EliteJdxReportOrderResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"jdxReportOrderResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)jdxReportOrderAsyncWithRequest:(EliteJdxReportOrderRequest*) jdxReportOrderRequest
                       completionHandler:(void(^)(int statusCode,EliteJdxReportOrderResponse* _Nullable jdxReportOrderResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteJdxReportOrderExecutor* excutor = [[EliteJdxReportOrderExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:jdxReportOrderRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxReportOrderResponse* response = [[EliteJdxReportOrderResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getSaleServiceByDeliverNumber sync request
@param getSaleServiceByDeliverNumberRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getSaleServiceByDeliverNumberResponse` the request response data model
*/
-(NSDictionary*) getSaleServiceByDeliverNumberSyncWithRequest:(EliteGetSaleServiceByDeliverNumberRequest*) getSaleServiceByDeliverNumberRequest
{
EliteGetSaleServiceByDeliverNumberExecutor* excutor = [[EliteGetSaleServiceByDeliverNumberExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getSaleServiceByDeliverNumberRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteGetSaleServiceByDeliverNumberResponse* response = [[EliteGetSaleServiceByDeliverNumberResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getSaleServiceByDeliverNumberResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getSaleServiceByDeliverNumberAsyncWithRequest:(EliteGetSaleServiceByDeliverNumberRequest*) getSaleServiceByDeliverNumberRequest
                       completionHandler:(void(^)(int statusCode,EliteGetSaleServiceByDeliverNumberResponse* _Nullable getSaleServiceByDeliverNumberResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteGetSaleServiceByDeliverNumberExecutor* excutor = [[EliteGetSaleServiceByDeliverNumberExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getSaleServiceByDeliverNumberRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteGetSaleServiceByDeliverNumberResponse* response = [[EliteGetSaleServiceByDeliverNumberResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
jdxCreateOrder sync request
@param jdxCreateOrderRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `jdxCreateOrderResponse` the request response data model
*/
-(NSDictionary*) jdxCreateOrderSyncWithRequest:(EliteJdxCreateOrderRequest*) jdxCreateOrderRequest
{
EliteJdxCreateOrderExecutor* excutor = [[EliteJdxCreateOrderExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:jdxCreateOrderRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxCreateOrderResponse* response = [[EliteJdxCreateOrderResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"jdxCreateOrderResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)jdxCreateOrderAsyncWithRequest:(EliteJdxCreateOrderRequest*) jdxCreateOrderRequest
                       completionHandler:(void(^)(int statusCode,EliteJdxCreateOrderResponse* _Nullable jdxCreateOrderResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteJdxCreateOrderExecutor* excutor = [[EliteJdxCreateOrderExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:jdxCreateOrderRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxCreateOrderResponse* response = [[EliteJdxCreateOrderResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
jdxQueryProduct sync request
@param jdxQueryProductRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `jdxQueryProductResponse` the request response data model
*/
-(NSDictionary*) jdxQueryProductSyncWithRequest:(EliteJdxQueryProductRequest*) jdxQueryProductRequest
{
EliteJdxQueryProductExecutor* excutor = [[EliteJdxQueryProductExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:jdxQueryProductRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryProductResponse* response = [[EliteJdxQueryProductResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"jdxQueryProductResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)jdxQueryProductAsyncWithRequest:(EliteJdxQueryProductRequest*) jdxQueryProductRequest
                       completionHandler:(void(^)(int statusCode,EliteJdxQueryProductResponse* _Nullable jdxQueryProductResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteJdxQueryProductExecutor* excutor = [[EliteJdxQueryProductExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:jdxQueryProductRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteJdxQueryProductResponse* response = [[EliteJdxQueryProductResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
confirmSaleServiceDelivery sync request
@param confirmSaleServiceDeliveryRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `confirmSaleServiceDeliveryResponse` the request response data model
*/
-(NSDictionary*) confirmSaleServiceDeliverySyncWithRequest:(EliteConfirmSaleServiceDeliveryRequest*) confirmSaleServiceDeliveryRequest
{
EliteConfirmSaleServiceDeliveryExecutor* excutor = [[EliteConfirmSaleServiceDeliveryExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:confirmSaleServiceDeliveryRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteConfirmSaleServiceDeliveryResponse* response = [[EliteConfirmSaleServiceDeliveryResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"confirmSaleServiceDeliveryResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)confirmSaleServiceDeliveryAsyncWithRequest:(EliteConfirmSaleServiceDeliveryRequest*) confirmSaleServiceDeliveryRequest
                       completionHandler:(void(^)(int statusCode,EliteConfirmSaleServiceDeliveryResponse* _Nullable confirmSaleServiceDeliveryResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
EliteConfirmSaleServiceDeliveryExecutor* excutor = [[EliteConfirmSaleServiceDeliveryExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:confirmSaleServiceDeliveryRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    EliteConfirmSaleServiceDeliveryResponse* response = [[EliteConfirmSaleServiceDeliveryResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 elite common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) eliteCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)eliteCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
